<?php

class Con_index extends Acan{
	
	public $defaultAct='index';
	public $Conread = '首页';
	public $Actread = array('index'=>'首页');
	function __construct($ainfo=null){
		parent::__construct($ainfo=null);
		$this->_S = Afun_session();
	}
	function Act_abody(){
		$anav_data = Afunc_nav()->anav_data('weibo',$this->Amode,$this->Aapp);//获取菜单
		if($this->Amode == '0'){$if_start = $this->Aapp.'-';}else{$if_start='';}
		$default_url = $if_start.'admin-index';
		include $this->Atpl('public/abody_mobile');
	}
	function Act_index(){
		$code_url = Afun_new('weibo')->auth();
		$this->_S = Afun_session();
		$Auser_json = Ajson_encode($this->_S);
		include $this->Atpl();
	}
	//认证成功回调
	function Act_auth_call(){
		$ass = Afun_new('weibo')->auth();
		$this->_S = Afun_session();
		$auth = $this->_S['Auth'];
		$data->ss = $ass;
		if($auth['oid']>0){
			$data->Auth = $this->_S['Auth'];
			$data->msg = "登入成功";
		}else{
			$data->data = "登入失败";
			$data->msg = $this->_S;
		}
		$data = Ajson_encode($data);
		include $this->Atpl();
	}
	function Act_mobile(){
		$code_url = Afun_new('weibo')->auth("mobile");
		$this->_S = Afun_session();
		$Auser_json = Ajson_encode($this->_S);
		include $this->Atpl("index/index");
	}
	function Act_js(){
		
		include $this->Atpl();
	}
	function Act_ready(){
		$Auser_json = Ajson_encode($this->_S);
		$muser = Afun_db()->model(Acan_table_weibo_user);
		$muserinfo = Afun_db()->model(Acan_table_weibo_userinfo);
		$oid = $this->_S['oid'];
		$data = $muserinfo->ofind("oid=$oid");
		if($data->birthday_date == "0000-00-00 00:00:00"){
			$data->birthday_date = '';
		}elseif(!empty($data->birthday_date)){
			$data->birthday_date = date("Y年m月d日 H时",strtotime($data->birthday_date));
		}
		include $this->Atpl();
	}
}

?>